package com.fowo.api.model.payable;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fowo.api.common.validator.EnumsString;
import javax.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;

/** 应付单 导入导出辅助模型 */
@Getter
@Setter
public class PayableExcelPo {

  @Size(max = 50, message = "单据编号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "单据编号")
  private String payCode;

  @NotNull(message = "供应商不能为空")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*供应商")
  private String supplierIdSupplierName;

  @ExcelIgnore
  @ExcelProperty(value = "*供应商")
  private Long supplierId;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "供应商名称")
  private String supplierIdSupplierFullName;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "数量")
  private String totalNum;

  @NotNull(message = "仓库不能为空")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*仓库")
  private String warehouseName;

  @ExcelIgnore
  @ExcelProperty(value = "*仓库")
  private Long warehouse;

  @NotNull(message = "结算组织不能为空")
  @Size(max = 50, message = "结算组织长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*结算组织")
  private String settlementOrgName;

  @ExcelIgnore
  @ExcelProperty(value = "*结算组织")
  private Long settlementOrg;

  @NotNull(message = "采购组织不能为空")
  @Size(max = 50, message = "采购组织长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*采购组织")
  private String purchasesOrgName;

  @ExcelIgnore
  @ExcelProperty(value = "*采购组织")
  private Long purchasesOrg;

  @NotNull(message = "入库日期不能为空")
  @DateTimeFormat("yyyy年MM月dd日")
  @ExcelProperty(value = "*入库日期")
  private java.util.Date businessDate;

  @NotNull(message = "审核日期不能为空")
  @DateTimeFormat("yyyy年MM月dd日")
  @ExcelProperty(value = "*审核日期")
  private java.util.Date settlementDate;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "金额")
  private String totalAmount;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "状态")
  private String stauts;

  @Size(max = 500, message = "备注长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "备注")
  private String remarks;

  @EnumsString(
    value = { "未推送", "成功", "失败" },
    message = "推送状态的可用值为 “未推送”, “成功”, “失败” 其中之一"
  )
  @Size(max = 50, message = "推送状态长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "推送状态")
  private String pushStatus;

  @Size(max = 50, message = "结果信息长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "结果信息")
  private String resultInfo;

  @NotBlank(message = "产品类型不能为空")
  @EnumsString(
    value = { "原材料", "成品", "加工" },
    message = "产品类型的可用值为 “原材料”, “成品”, “加工” 其中之一"
  )
  @Size(max = 50, message = "产品类型长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*产品类型")
  private String productType;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "制单人")
  private String preparedByName;

  @ExcelIgnore
  @ExcelProperty(value = "制单人")
  private Long preparedBy;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "审核人")
  private String verifierName;

  @ExcelIgnore
  @ExcelProperty(value = "审核人")
  private Long verifier;

  @Size(max = 50, message = "采购单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "采购单号")
  private String purchaseOrder;

  @Size(max = 50, message = "入库单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "入库单号")
  private String warehouseSn;

  @EnumsString(
    value = { "未结账", "已结账" },
    message = "结款状态的可用值为 “未结账”, “已结账” 其中之一"
  )
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "结款状态")
  private String settlementStatus;

  @EnumsString(
    value = { "低客单价", "高客单价" },
    message = "categoryId的可用值为 “低客单价”, “高客单价” 其中之一"
  )
  @Size(max = 50, message = "categoryId长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "categoryId")
  private String categoryId;
}
